package com.ls.smartcampus2.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSenderImpl;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author dell
 */

@RestController
public class FeedBackController {
@Autowired
    JavaMailSenderImpl mailSender;
@GetMapping("/sendMail")
    public String getMail(String mail){
        SimpleMailMessage mailMessage=new SimpleMailMessage();
        mailMessage.setSubject("意见反馈");
        mailMessage.setText(mail);
        mailMessage.setTo("2711553140@qq.com");
        mailMessage.setFrom("2711553140@qq.com");
          mailSender.send(mailMessage );
    System.out.println("发送成功");
        return "success";


    }
}
